﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpArch.Core.DomainModel;

namespace TrilhaImovel.Core.Entities
{
    public class GeocodingLog : Entity
    {
        public virtual long NumberOfAccess { get; set; }
        public virtual DateTime DayOfUse { get; private set; }

        public GeocodingLog()
        {
            DateTime now = DateTime.Now;

            NumberOfAccess = 0;
            DayOfUse = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0);
        }

        public virtual void SetNewAcess()
        {
            NumberOfAccess += 1;
        }

        public virtual bool IsGeocodingAcessible(int numberLimitOfAccess)
        {
            return NumberOfAccess <= numberLimitOfAccess;
        }
    }
}
